//前端路由表 根据后端新增路由来新增组件

import goods from "@/layout/goods/index.vue";

export let PathAndComponent = [
    {
        id: '1',
        path: '/home',
        meta: {
            icon: 'el-icon-s-home',
        },
        name: 'home',
        component: () => import('@/layout/home/index.vue')
    },
    {
        id: "2",
        path: '/user',
        name: 'user',
        meta: {
            icon: 'el-icon-user-solid',
        },
        redirect: '/user/list',
        props(route) {
            return route
        },
        children: [
            {
                path: "/user/list",
                name: "userList",
                component: () => import('@/layout/user/components/list.vue')
            },
            {
                path: '/user/edit/:id',
                name: "userEdit",
                props(route) {
                    return route;
                },
                component: () => import('@/layout/user/components/edit.vue')
            }
        ],
        component: () => import('@/layout/user/index.vue')
    },
    {
        id: '3',
        path: '/setting',
        meta: {
            icon: 'el-icon-setting',
        },
        name: 'setting',
        component: () => import('@/layout/setting/index.vue')
    },
    {
        id: '4',
        path: '/goods',
        meta: {
            icon: 'el-icon-s-goods',
        },
        name: 'goods',
        redirect: '/goods/list',
        component: () => import('@/layout/goods/index.vue'),
        children: [
            {
                name: 'goods_list',
                path: '/goods/list',
                component: () => import('@/layout/goods/goodsList.vue')
            },
            {
                name: 'goods_edit_dong_tai',
                path: '/goods/:type',
                props: route => route.params,
                component: () => import('@/layout/goods/handleGoods.vue')
            }
        ]
    },
    {
        id: '5',
        path: '/order',
        meta: {
            icon: 'el-icon-s-order',
        },
        name: 'order',
        component: () => import('@/layout/order/index.vue')
    }
]

